import React, { Component } from 'react';
import {Image, View} from "@tarojs/components";
import Taro from '@tarojs/taro';
import GzhAuth from "../../components/gzh-auth/gzh-auth"
import {vcmonitor} from "../../utils/tools";
import './addcontact.scss'

class formGuide extends Component {
  async componentDidShow(){
    vcmonitor(this);
  }
  UNSAFE_componentWillMount() {
    this.page = Taro.getCurrentInstance().router.params.page
  }
  copy() {
    try {
      Taro.setClipboardData({
        data: 'https://resource.ivcheng.com/upload/file/fbbac1ea6ef9486a8b88b912f7e72759.xlsx'
      })
      Taro.showToast({title: '复制成功'})
    } catch (e) {
      Taro.showToast({title: '复制失败'})
    }
  }
  page
  render() {
    return (
      <View className='addcontact-root'>
        <GzhAuth />
        { this.page !== 'table' && <Image className='form-guide' src='https://resource.ivcheng.com/upload/images/20210727/1627349973124_355.png' mode='widthFix' /> }
        { this.page === 'table' && <View className='guide-table'>
          <Image className='form-guide' src='https://resource.ivcheng.com/upload/images/20210812/1628754496319_505.png' mode='widthFix' />
          <Image onClick={this.copy.bind(this)} className='form-guide-table' src='https://resource.ivcheng.com/upload/images/20210812/1628754558936_485.png' mode='widthFix' />
        </View> }
      </View>
    )
  }
}

export default formGuide
